function parseURLParams(queryOrFragment){
	var params = {}, paramsString = queryOrFragment ? location.search.substring(1) : location.hash.substring(1), regex = /([^&=]+)=([^&]*)/g, m;
	while (m = regex.exec(paramsString)) {
		params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
	}
	return params;
}

